# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-astor
pkgver=0.8.1
pkgrel=6
pkgdesc="Read/rewrite/write Python ASTs"
arch=('any')
license=('BSD')
url="https://astor.rtfd.org/"
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-nose' 'python-tests')
source=("$pkgname-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz")
sha512sums=('8917898e284fb5e5855a05f8e3f1c8925c4128d2a87f67f0334914d4d3c54b53c4f0cadd04d632a7bcaf3438db7edf2d989b07a9576637c0dce6c16e85c60f83')

build() {
  cd astor-$pkgver
  python setup.py build
}

check() {
  cd astor-$pkgver
  nosetests3 || echo "https://github.com/berkerpeksag/astor/issues/146"
}

package() {
  cd astor-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
